package com.glacier.excel.domain.builder;

import com.glacier.excel.domain.HeaderMeta;

import java.util.List;

/**
 * date 2021-06-15 14:50
 *
 * @author glacier
 * @version 1.0
 */
public final class HeaderMetaBuilder {
    private String header;
    private List<String> validates;
    private int width;
    
    private HeaderMetaBuilder() {
    }
    
    public static HeaderMetaBuilder aHeaderMeta() {
        return new HeaderMetaBuilder();
    }
    
    public HeaderMetaBuilder withHeader(String header) {
        this.header = header;
        return this;
    }
    
    public HeaderMetaBuilder withValidates(List<String> validates) {
        this.validates = validates;
        return this;
    }
    
    public HeaderMetaBuilder withWidth(int width) {
        this.width = width;
        return this;
    }
    
    public HeaderMeta build() {
        HeaderMeta headerMeta = new HeaderMeta();
        headerMeta.setHeader(header);
        headerMeta.setValidates(validates);
        headerMeta.setWidth(width);
        return headerMeta;
    }
}
